package com.bjsxt.livegoods.order.service.service.impl;

import com.bjsxt.livegoods.dao.order.OrderDao;
import com.bjsxt.livegoods.entity.Order;
import com.bjsxt.livegoods.order.service.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderDao orderDao;
    @Override
    public List<Order> findOrders(String user) {
        Query query=new Query();
        query.addCriteria(Criteria.where("userPhone").is(user));
        List<Order> orders=orderDao.findOrders(query);
        return orders;
    }
}
